<script type="text/javascript">
function addChar( id, s ) {
var el = document.getElementById( id );
el.value = el.value + s + '</b><ul>' + String.fromCharCode(10);
//var len=el.value.length;
//el.setSelectionRange(len,len);
el.focus();
}
function save() {
var el = document.getElementById( 'editor' );
el.style.visibility = "hidden";
vote( el.value );
//var s =el.value;
//alert( s );
//document.getElementById( 'desc' ).innerHTML = '<ul style="list-style-type:circle"><li>' + s;
}
function getXmlHttp() {
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function vote( str ) {
var rand = Math.random();
var req = getXmlHttp()
req.onreadystatechange = function() {
if (req.readyState == 4) {
if(req.status == 200) {
alert("Ответ сервера: "+req.responseText);
document.getElementById( 'editor' ).style.visibility = "visible";
}
}
}
req.open('POST', '/cgi-bin/ajax/savedesc.pl?' + rand, true);
req.send( str ); // отослать запрос
}
</script>
http://www.pcshop.ru/cgi-bin/techdesc.pl?id=6715
При нажатии на сохранить в Мозилле выдает ошибку
ActiveXObject is not defined
Line 23
В Эксплорере и Хроме работает.
Проблема видимо в реализации метода POST.